import request from '../../utils/request';
const mod = {
    state: {

    },

    getters: {

    },

    mutations: {

    },

    actions: {
        
        /** 
         * 案件订单列表
         * startDay string
         * endDay   string
         * userId   string
         * lawyerId string
         * state    string
         * payType  string
         * pageNum  string
         * pageSize string
         * */ 
        GET_ORDER_CASE_list({ commit }, payload) {
            return new Promise((resolve, reject) => {
                request.post('/order/orderCaseList.htm', payload).then(res => {
                    console.log('res::', res);
                    console.log('commit::', commit);
                    resolve(res);
                }).catch(err => {
                    console.error('err::::', err);
                    reject(err);
                })
            });
        },
        /**
         * 查询提现
         * 案件状态 tendering("招标中"), solving("进行中"), done("结束")， delete("作废")
         * @payload{
         *  userId   string
         *  caseId   string
         *  pageNum  string
         *  province string
         *  city     string
         *  startDay string
         *  endDay   string
         *  userMobileNo string
         *  lawyerMobileNo string
         *  lawyerName string
         * }
         * */
        GET_WITHDRAW_LIST({ commit }, payload) {
            return new Promise((resolve, reject) => {
                request.post('/capital/withdrawList.htm', payload).then(res => {
                    console.log('res::', res);
                    console.log('commit::', commit);
                    resolve(res);
                }).catch(err => {
                    console.error('err::::', err);
                    reject(err);
                })
            });
        },
        GET_WITHDRAW_SETTING({ commit }, payload) {
            return new Promise((resolve, reject) => {
                request.post('/capital/getContants.htm', payload).then(res => {
                    console.log('res::', res);
                    console.log('commit::', commit);
                    resolve(res);
                }).catch(err => {
                    console.error('err::::', err);
                    reject(err);
                })
            });
        },
        SET_WITHDRAW({ commit }, payload) {
            return new Promise((resolve, reject) => {
                request.post('/capital/setContants.htm', payload).then(res => {
                    console.log('res::', res);
                    console.log('commit::', commit);
                    resolve(res);
                }).catch(err => {
                    console.error('err::::', err);
                    reject(err);
                })
            });
        },
        UPDATE_WITHDRAW({ commit }, payload) {
            return new Promise((resolve, reject) => {
                request.post('/capital/audit.htm', payload).then(res => {
                    console.log('commit::', commit);
                    resolve(res);
                }).catch(err => {
                    console.error('err::::', err);
                    reject(err);
                })
            });
        }


    }
}

export default mod